package de.koller.worlders.engine.entity.enc;

import de.koller.oceanFramework.tree.Child;
import de.koller.worlders.WSea;
import de.koller.worlders.engine.entity.enc.gu.GUMob;
import de.koller.worlders.engine.entity.enc.pathfinding.GUPathFinder;

public class EncRoot extends WSea {
	
	private boolean enabled = false;
	
	//@Child private final GUMob gutest = new GUMob( 63, 60 );
	//@Child private final GUMob gutest2 = new GUMob( 65, 60 );
	
	private GUMob targetedMob = null;
	@Child private final EncSteering encSteering = new EncSteering();
	public GUPathFinder pathfinder;

	@Override
	protected void init() {
		super.init();
		
		pathfinder = new GUPathFinder( wroot );
	}
	
	public void setEnabled( boolean enabled ) {
		this.enabled = enabled;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public boolean isTargetedMob( GUMob me ) {
		return me == targetedMob;
	}

	public void setTargetedMob( GUMob me ) {
		if( isTargetedMob( me ) )
			this.targetedMob = null;
		else
			this.targetedMob = me;
	}

	public GUMob getTargetedMob() {
		return targetedMob;
	}

}
